<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试网页</title>

    <style>

        * {
            margin: 0;
            padding: 0;
        }

        html,
        body {
            width: 100%;
            height: 100%;
        }

        .side {
            width: 15%;
            height: 100%;
            float: left;
        }

        .main {
            width: 85%;
            height: 100%;
            float: left;
        }

        .main iframe {
            width: 100%;
            height: 100%;
        }
    </style>
</head>

<body>
    <div class="side">
        <h1 style="align-content: center;color: white;">我是本地测试网页</h1>
        <button id="btn1">调用C#方法，无参数</button>
        <button id="btn2">调用C#方法，传递参数</button>
        <button id="btn3">从C#中获取字符串</button>
        <button id="btn4">异步从C#中获取字符串</button>
        <button id="btn5">选择文件</button>
    </div>

    <div class="main">
        <iframe src="http://devwk.xm0760.vip/help.html" frameborder="0"></iframe>
    </div>

</body>
<script>
    function show(item) {
        alert(item);
    }
    window.onload = function () {
        var btn1 = document.getElementById('btn1');
        var btn2 = document.getElementById('btn2');
        var btn3 = document.getElementById('btn3');
        var btn4 = document.getElementById('btn4');
        var btn5 = document.getElementById('btn5');

        btn1.onclick = function () {
            main.show();
        }

        btn2.onclick = function () {
            main.showName('zhangsan')
        }

        btn3.onclick = function () {
            alert(main.getName())
        }

        btn4.onclick = function () {
            main.getNameAsync(function (result) {
                alert(result)
            })
        }

        btn5.onclick = function () {
            main.chooseImage(item => alert(item));
        }
    }
</script>

</html>